{% extends 'layout.html' %}

{% block main %}
<ol class="breadcrumb">
	<li><a href="/admin">后台首页</a></li>
	<li><span>内容首页</span></li>
</ol>
<h4>内容列表</h4>
<div class="container-fluid">
	<table class="table table-hover table-striped">
		<tr>
			<th>ID</th>
			<th>分类</th>
			<th>标题</th>
			<th>作者</th>
			<th>时间</th>
			<th>浏览量</th>
			<th>操作</th>
		</tr>
		{% for content in contents %}
		<tr>
			<td>{{content._id.toString()}}</td>
			<td>{{content.category.name.toString()}}</td>
			<td>{{content.title}}</td>
			<td>{{content.user.username}}</td>
			<td>{{content.date|date('Y年m月d日 H:i:s',-8*60)}}</td>
			<td>{{content.views}}</td>
			<td>
				<a href="/admin/content/edit?id={{content._id.toString()}}">编辑</a>|
				<a href="/admin/content/delete?id={{content._id.toString()}}">删除</a>|
				<a href="">查看</a>|
			</td>
		</tr>
		{% endfor %}
	</table>
</div>
{% include 'page.html' %}
{% endblock %}